+2006-05-15 Alexander Larsson <alexl@redhat.com>
+
+ * gtk/gtk.symbols:
+ * gtk/gtkprintbackend.[ch]: (_gtk_print_backend_create):
+ Never unload print backends.
+ Remove gtk_print_backend_unref_at_idle.
+
+ * modules/printbackends/cups/gtkprintbackendcups.c:
+ (cups_dispatch_watch_finalize):
+ Don't use the unref_at_idle hack since that caused
+ deadlocks. Instead we never unload print backends, which
+ is not really a big problem.
+
2006-05-14 Murray Cumming <murrayc@murray.com>
* gtk/gtkframe.c: Restored the / at the start of the comment
+2006-05-15 Alexander Larsson <alexl@redhat.com>
+
+ * gtk/gtk.symbols:
+ * gtk/gtkprintbackend.[ch]: (_gtk_print_backend_create):
+ Never unload print backends.
+ Remove gtk_print_backend_unref_at_idle.
+
+ * modules/printbackends/cups/gtkprintbackendcups.c:
+ (cups_dispatch_watch_finalize):
+ Don't use the unref_at_idle hack since that caused
+ deadlocks. Instead we never unload print backends, which
+ is not really a big problem.
+
2006-05-14 Murray Cumming <murrayc@murray.com>
* gtk/gtkframe.c: Restored the / at the start of the comment
gtk_print_backend_find_printer
gtk_print_backend_print_stream
gtk_print_backend_load_modules
-gtk_print_backend_unref_at_idle
#endif
#endif
#endif
pb_module);
pb = _gtk_print_backend_module_create (pb_module);
+
+ /* Increase use-count so that we don't unload print backends.
+ There is a problem with module unloading in the cups module,
+ see cups_dispatch_watch_finalize for details. */
+ g_type_module_use (G_TYPE_MODULE (pb_module));
}
g_free (module_path);
dnotify);
}
-static gboolean
-unref_at_idle_cb (gpointer data)
-{
- g_object_unref (data);
- return FALSE;
-}
-
-void
-gtk_print_backend_unref_at_idle (GtkPrintBackend *print_backend)
-{
- g_idle_add (unref_at_idle_cb, print_backend);
-}
-
void
gtk_print_backend_destroy (GtkPrintBackend *print_backend)
{
gpointer user_data,
GDestroyNotify dnotify);
GList * gtk_print_backend_load_modules (void);
-void gtk_print_backend_unref_at_idle (GtkPrintBackend *print_backend);
void gtk_print_backend_destroy (GtkPrintBackend *print_backend);
/* Backend-only functions for GtkPrintBackend */
if (dispatch->backend)
{
/* We need to unref this at idle time, because it might be the
- last reference to this module causing the code to be
- unloaded (including this particular function!)
- */
- gtk_print_backend_unref_at_idle (GTK_PRINT_BACKEND (dispatch->backend));
+ * last reference to this module causing the code to be
+ * unloaded (including this particular function!)
+ * Update: Doing this at idle caused a deadlock taking the
+ * mainloop context lock while being in a GSource callout for
+ * multithreaded apps. So, for now we just disable unloading
+ * of print backends. See _gtk_print_backend_create for the
+ * disabling.
+ */
+ g_object_unref (dispatch->backend);
dispatch->backend = NULL;
}